home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / BOOT-SS.ASM < prev    next >
Assembly Source File  |  1986-01-03  |  3KB  |  115 lines

  1. ; Boot Record Program (C) Copyright Peter Norton 1986
  2.  
  3. boots segment 'code'
  4.  
  5.       public boot
  6.  
  7.       assume cs:boots
  8.  
  9. boot  proc   far
  10.  
  11. ;  30-byte DOS info -- set up for 1-side, 8-sector
  12. ;  change as needed for any other format
  13.  
  14. head:
  15.       jmp    begin      ; EB 2A 90 as per normal
  16.       db     ' Norton ' ; 8-byte system id
  17.       dw     512        ; sector size in bytes
  18.       db     1          ; sectors per cluster
  19.       dw     1          ; reserved clusters
  20.       db     2          ; number of fats
  21.       dw     64         ; root directory entries
  22.       dw     320        ; total sectors
  23.       db     0FEh       ; format id
  24.       dw     1          ; sectors per fat
  25.       dw     8          ; sectors per track
  26.       dw     1          ; sides
  27.       dw     0          ; special hidden sectors
  28.  
  29. ; mysterious but apparently standard 14-byte filler
  30.       db     14 dup (0)
  31.  
  32. ; carry on with the boot work
  33.  
  34. begin:
  35.       mov    ax,07C0h   ; boot record location
  36.       push   ax
  37.       pop    ds
  38.       mov    bx,message_offset  ; put offset to message into si
  39.       mov    cx,message_length  ; message length from cx
  40. continue:
  41.       mov    ah,14      ; write teletype
  42.       mov    al,[bx]
  43.       push   ds
  44.       push   cx
  45.       push   bx
  46.       int    10h
  47.       pop    bx
  48.       pop    cx
  49.       pop    ds
  50.       inc    bx
  51.       loop   continue
  52.  
  53.       mov    ah,0       ; read next keyboard character
  54.       int    16h
  55.  
  56.       mov    ah,15      ; get video mode
  57.       int    10h
  58.       mov    ah,0       ; set video mode (clears screen)
  59.       int    10h
  60.  
  61.       int    19h        ; re-boot
  62.  
  63. beg_message:
  64.       db     0Dh,0Ah    ; carriage return, line-feed
  65.       db     0Dh,0Ah
  66.       db     0Dh,0Ah
  67.       db     0Dh,0Ah
  68.       db     '     Start your computer with'
  69.       db     0Dh,0Ah
  70.       db     '     a DOS system diskette.'
  71.       db     0Dh,0Ah
  72.       db     0Dh,0Ah
  73.       db     0Dh,0Ah
  74.       db     '     This is'
  75.       db     0Dh,0Ah
  76.       db     '        The Norton Utilities'
  77.       db     0Dh,0Ah
  78.       db     '            Version 3.0'
  79.       db     0Dh,0Ah
  80.       db     '     from'
  81.       db     0Dh,0Ah
  82.       db     '         Peter Norton'
  83.       db     0Dh,0Ah
  84.       db     '         2210 Wilshire Blvd'
  85.       db     0Dh,0Ah
  86.       db     '         Santa Monica, CA 90403'
  87.       db     0Dh,0Ah
  88.       db     0Dh,0Ah
  89.       db     '           (213) 826-8092'
  90.       db     0Dh,0Ah
  91.       db     0Dh,0Ah
  92.       db     0Dh,0Ah
  93.       db     0Dh,0Ah
  94.       db     '    Insert a DOS diskette'
  95.       db     0Dh,0Ah
  96.       db     '    Press any key to start DOS ... '
  97. end_message:
  98.  
  99. ; I put a copyright notice here; you do if you want to ...
  100. tail:
  101.  
  102. message_offset equ beg_message - head
  103. message_length equ end_message - beg_message
  104. filler_amount  equ 512 - (tail - head) - 2
  105.  
  106.       db     filler_amount dup (0)      ; filler
  107.  
  108.       db     055h,0AAh                  ; boot id
  109.  
  110. boot  endp
  111.  
  112. boots ends
  113.  
  114.       end
  115.